<template>
	<view class="myactiveinfo" v-if="info">
		<image class="myactiveinfo_bk" :src="onlinePic+'myactive_bk.png'" mode="widthFix"></image>
		<view class="myactiveinfo_ticket_box">
			<view class="myactiveinfo_ticket_top">
				<view :class="'myactive_audit' + (info.sign_status == 1 ? ' audit_end' : ' audit_ing')">
					{{ info.huodong_use_text }}
				</view>
				<view class="myactiveinfo_qrcode_box">
					<image class="myactiveinfo_qrcode" :src="picUrl + info.qr_code">
					</image>
					<view class="qrcode_mask" v-if="info.sign_status == 1"></view>
				</view>

				<view class="f-18 mt-15 f-w">{{ info.huodong_ticket_text }}</view>
				<view class="f-12 mt-5 c-gray">{{ info.huodong_tips }}</view>
			</view>
			<view class="myactiveinfo_ticket_bottom">
				<view class="f-18 f-w">{{ info.huodong_title }}</view>
				<view class="display_flex mt-20">
					<image class="myactiveinfo_time" :src="onlinePic+'myactiveinfo_time.png'"></image>
					<view class="f-15 ml-10">{{ info.huodong_date }}</view>
				</view>
				<view class="c-gray f-13 mt-5 ml-20">{{ info.huodong_time }}</view>
				<view class="display_flex mt-20">
					<image class="myactiveinfo_location" :src="onlinePic+'myactiveinfo_location.png'"></image>
					<view class="f-15 ml-10">{{ info.huodong_city }}</view>
				</view>
				<view class="c-gray f-13 mt-5 ml-20">{{ info.huodong_address }}</view>
			</view>



			<!-- 	<view class="myactiveinfo_info_box">
				<view class="myactiveinfo_info_cell">
					<view class="display_flex">
						<view class="f-16 f-w">傲虎北京车友会春季露营</view>
						<view class="myactive_audit audit_ing">报名成功</view>
						<view class="myactive_audit audit_end">已结束</view>
					</view>
					<view class="c-999999 f-13 mt-10">这个春天,一起穿过人海归山林,仰望暴雨般的星光，相约北京怀柔白河湾。</view>
				</view>
				<view class="myactiveinfo_info_cell">
					<view class="f-16 f-w">3月3日 星期日</view>
					<view class="f-14 mt-10">10:00 - 16:00</view>
				</view>
				<view class="myactiveinfo_info_cell">
					<view class="f-16 f-w">白河湾水岸桃源露营基地</view>
					<view class="f-14 mt-10">北京市怀柔区白河湾</view>
				</view>
			</view> -->
		</view>

	</view>
</template>

<script>
	import {
		getClubMyActiveInfo,
	} from '@/api/motortime.js';
	let app = getApp()
	export default {
		data() {
			return {
				timerId:'',
				huodong_id: '',
				info: '',
				picUrl: app.globalData.picUrl,
				onlinePic: app.globalData.onlinePic,
			};
		},
		onShow() {

		},
		onLoad(options) {
			var that = this
			that.huodong_id = options.huodong_id
			that.getClubMyActiveInfo()
			that.timerId = setInterval(function() {
				that.getClubMyActiveInfo()
			}, 1000 * 30);
		},
		onHide() {
			clearInterval(this.timerId);
		},
		onUnload() {
			clearInterval(this.timerId);
		},
		methods: {
			getClubMyActiveInfo() {
				getClubMyActiveInfo({
					huodong_id: this.huodong_id
				}).then(res => {
					if (res.state == 1) {
						this.info = res.data.info
						if (this.info.sign_status == 1) {
							clearInterval(this.timerId);
						}
						var params = {
							event_code: '我的活动详情',
							path: 'pages/my/myactiveinfo',
							event_id: this.huodong_id,
							title: res.data.info.huodong_title,
							source_page: '',
							value: '',
						}
						app.BurialPoint(params)
					} else {
						uni.showToast({
							title: res.error[0],
							mask: true,
							icon: 'none',
							duration: 1500
						})
					}
				})
			},
		},
	}
</script>

<style lang="scss">
	.myactiveinfo {
		width: 100%;
		height: 100vh;
		position: relative;

		.myactiveinfo_bk {
			width: 100%;
			vertical-align: middle;
		}

		.myactiveinfo_ticket_box {
			position: absolute;
			top: 16%;
			left: 0;
			right: 0;
			padding: 35rpx;
			z-index: 1;

			.myactiveinfo_ticket_top {
				position: relative;
				text-align: center;

				.myactiveinfo_qrcode {
					width: 220rpx;
					height: 220rpx;
					vertical-align: middle;
					border-radius: 100%;
				}

				.myactiveinfo_qrcode_box {
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: center;
				}

				.qrcode_mask {
					width: 220rpx;
					height: 220rpx;
					border-radius: 100%;
					position: absolute;
					/* 设置伪元素绝对定位于容器上方 */
					top: 0;
					bottom: 0;
					background-color: rgba(255, 255, 255, 0.9);
					/* 设置蒙层颜色及不透明度 */
					z-index: 2;
				}

			}

			.myactiveinfo_ticket_bottom {
				margin-top: 20%;
				padding-left: 70rpx;

				.myactiveinfo_time {
					width: 25rpx;
					height: 25rpx;
					vertical-align: middle;
				}

				.myactiveinfo_location {
					width: 23rpx;
					height: 27rpx;
					vertical-align: middle;
				}
			}


		}





		.myactiveinfo_info_box {
			padding: 35rpx;

			.myactiveinfo_info_cell {
				padding: 30rpx 0;
				border-bottom: 1rpx solid #E9E9E9;
			}
		}

		.myactive_audit {
			width: 110rpx;
			color: #ffffff;
			font-size: 24rpx;
			padding: 5rpx 0;
			border-radius: 8rpx;
			position: absolute;
			top: -20rpx;
			right: 42rpx;
		}

		.audit_ing {
			border: 1rpx solid #07C061;
			background-color: #07C061;
		}

		.audit_end {
			border: 1rpx solid #A9A9A9;
			background-color: #A9A9A9;
		}
	}
</style>